//
//  UILabel+LineSpace.m
//  Pad-test
//
//  Created by jayce on 17/3/24.
//  Copyright © 2017年 jjkj. All rights reserved.
//

#import "UILabel+LineSpace.h"

@implementation UILabel (LineSpace)

+(void)changeLineSpaceForLabel:(UILabel *)label WithSpace:(float)space {
    
    NSString *labelText = label.text;
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:labelText];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:space];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [labelText length])];
    label.attributedText = attributedString;
    [label sizeToFit];

}

@end
